//
//  SupportView.swift
//  FeastBooking
//
//  Created by Imon on 2017/12/17.
//  Copyright © 2017年 Imon. All rights reserved.
//

import UIKit

class SupportView: UIView {

    let supportLabel: UILabel = {
        let label = UILabel()
        label.textColor = UIColor.lightGray
        label.font = AppFont(size: 13)
        label.text = "\(LanguageHelper.getString(key: "SUPPORT_EMAIL")): \(supportEmail)"
        return label
    }()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.backgroundColor = UIColor.white
        self.addSubview(supportLabel)
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        let textMaxSize = CGSize(width: bounds.width, height: 40)
        let supportSize = TextSize.textSize(text: supportLabel.text!, font: supportLabel.font, maxSize: textMaxSize)
        supportLabel.frame = CGRect(x: (self.bounds.width - supportSize.width) / 2, y: (self.bounds.height - supportSize.height) / 2, width: supportSize.width, height: supportSize.height)
    }
}
